Magnetic sensor with offset magnetic field

ABSTRACT

A method, a magnetic field sensor, and an electronic device measure and determine the magnitude and/or the direction of a magnetic field. The magnetic sensor is based on at least a first magnetoresistive-layered structure having an electric resistance depending on the magnitude of the magnetic field. The magnetic sensor generates at least a first offset magnetic field. The magnitude and the direction of the offset magnetic field can be modified to compensate the magnetic field. The electric resistance of the magnetoresistive-layered structure depends on the superposition of magnetic field and offset magnetic field. A maximum electric resistance indicates that the magnetic field is compensated by the offset magnetic field. In this case the magnitude of the magnetic field corresponds to the magnitude of the offset magnetic field, and the direction of the magnetic field is given by the reversed direction of the offset magnetic field.

RELATED PATENT APPLICATIONS

The present patent application claims priority to and the benefit of,under 35 USC 119, the European Patent Office patent application entitled“Magnetic sensor with offset magnetic field,” filed on Oct. 21, 2004,and assigned application no. 04105207.7.

FIELD OF THE INVENTION

The present invention relates generally to magnetic sensors, and moreparticularly to such magnetic sensors that use the magnetoresistiveeffect.

BACKGROUND OF THE INVENTION

Magnetoresistive elements feature an electrical resistance that stronglydepends on the magnitude and/or direction of an externally appliedmagnetic field. Generally, there exist a large variety of differentmagnetoresistive elements making use of different fundamental effects.For example, the Anistropic Magnetoresistive (AMR) effect shows a changein electrical resistance in the presence of a magnetic field. AMRsensors are typically made of a soft-magnetic material, such asnickel-iron (Permalloy) thin film deposited on a silicon wafer. Themagnetoresistive effect is dependent mainly on the relative directionbetween an electrical current and the direction of magnetization.

Another effect is the oscillatory exchange interaction of ferromagneticlayers depending on the thickness of the normal metal spacer layer andthe giant magneto resistance (GMR) in the exchange-coupled multilayers.The latter effect is driven by the relative magnetic orientation of theadjacent ferromagnetic layers. Replacing the non-magnetic layers by aninsulator eliminates the exchange. However, by pinning the firstferromagnetic layer with an anti-ferromagnetic layer an anti-paralleloriented stack can be caused by an external magnetic field. Applying theelectric current perpendicular through the ferromagnetic-insulatingferromagnetic stack results in a large change of the tunnel magnetoresistance (TMR).

In general, the magnitude and/or direction of the magnetic field can bemeasured by using at least one magnetoresistive element. However, usingonly one element makes the device rather sensitive to externally drivendrifts, such as temperature and hysteresis drifts. In order to avoidthis problem, relative measurements, being sensitive just to externalmagnetic changes, can be performed. This can be realized, for example,in a Wheatstone bridge arrangement. At least four elements of identicalresistance are required. Two adjacent pairs of elements typicallyexhibit different magnetoresistive behaviors. In such a design, themeasured signal is proportional to the relative changes of the magnetoresistance of adjacent resistance pairs.

Moreover, when implemented in combination with elements made of softmagnetic material, such as Permalloy, various components of theexternally applied magnetic field can be effectively separated andseparately detected, thus allowing for a determination of the directionof the magnetic field. Hence, a Wheatstone bridge arrangement serves asa universal tool to generate an electrical signal that depends on themagnitude and/or the direction of an externally applied magnetic field.

In typical implementations, such a Wheatstone bridge features an offsetdrift that might be caused by slight deviations of the electrical and/ormagnetic properties of its components. Even magnetoresistive elements ofthe same type series might be subject to inevitable productiontolerances. Consequently, a bridge circuit may provide a non-zero outputvoltage even in the absence of a magnetic field. This offset of a bridgecircuit is in particular rather disadvantageous, when magnetic fields oflow magnitude have to be measured, such as the earth magnetic field. Insuch cases the offset of a Wheatstone bridge might be in the same rangeas the signal that has to be measured.

Offset drift elimination can, for example, be performed by a so-calledflipping procedure when AMR elements are implemented in the bridgecircuit. A short magnetic pulse can be applied to the sensor element inorder to reverse its sensitivity. Making use of periodically alternatedflipping pulses and a lock-in amplifier, the resulting output of thebridge becomes independent of sensor and amplifier offset. This flippingprocedure is only applicable to AMR elements that generally feature alimited magnetic sensitivity, and a rather large size and a relativelylow electric resistance that leads to fairly high power consumption inoperation mode.

In contrast to AMR elements, GMR elements feature a significantly highermagnetic sensitivity, and they are smaller in size and have a higherelectrical resistance. However, the flipping procedure for offsetcompensation cannot be applied to GMR elements, because GMR elements donot inherently allow a reversal of their sensitivity. GMR multilayerelements feature another disadvantage in form of being insensitive tothe direction of a magnetic field. Directional magnetic field sensorscan therefore be implemented by making use of AMR elements or GMR spinvalves that feature a spatially fixed ferromagnetic layer and a freelayer, whose magnetization is free to follow an external magnetic field.In general, spin valves may be permanently destroyed by high magneticfield or current pulses. Additionally, such structures are also moresensitive to high temperatures than multilayers. Moreover, GMR spinvalves require additional production processes as compared to standard,non-pinned GMR elements.

In principle, a directional sensor can be implemented on the basis ofGMR multilayer elements in combination with flux guides providingspatial decomposition components of a magnetic field. Furthermore, inprinciple, determination of a direction of a magnetic field is possiblewith the above-mentioned magnetoresistive elements and configurations.However, all these approaches may suffer from temperature drift,mechanical stress or hysteresis of the magnetoresistive elements.

Even though AMR and GMR spin valve elements provide an electricresistance that depends on the direction of an external magnetic field,these elements inherently do not provide an unequivocal determination ofthe direction of the magnetic field. Typically, the electric resistanceof those magnetoresistive elements inherently features a periodicity of90°. An unequivocal determination of the direction of the magnetic fieldover a range from zero to 3600 is rather sophisticated and requires, forexample, an implementation of a plurality of bridge circuits.

Therefore, there is a need in the prior art for an improved offsetcompensation for bridge circuits that makes use of magnetoresistiveelements and that provides an improved direction determination of amagnetic field. For these and other reasons, there is a need for thepresent invention.

SUMMARY OF THE INVENTION

The present invention provides a magnetic field sensor for measuring anexternal magnetic field. The inventive magnetic field sensor includesmeans, or a mechanism, for generating an at least first offset magneticfield and further includes at least a first magnetoresistive-layeredstructure that has an electrical resistance depending on the magnitudeof a first magnetic field. This first magnetic field includes componentsof the external magnetic field and components of the offset magneticfield.

The at least first magnetoresistive-layered structure of the magneticfield sensor is adapted to sense a superimposed magnetic field. Thissuperimposed magnetic field has a contribution from the externalmagnetic field and from the at least first offset magnetic field that isgenerated by the magnetic field sensor itself. The offset magnetic fieldis either constant or can be arbitrarily modified. In any case, themagnitude and/or direction of the offset magnetic field is known.

Hence, the offset magnetic field can be used for calibration or/andapplying an appropriate measurement procedure. Measuring the electricresistance of the at least first magnetoresistive-layered structure isindicative of the superimposed magnetic fields. Since magnitude and/ordirection of the offset magnetic field are known, magnitude anddirection of the external field can be derived from the measuredelectrical resistance of the magnetoresistive-layered structure. Thus,the magnitude of the external magnetic field can be precisely determinedirrespective of any inherent offset or intrinsic deviation of themagnetic or electrical properties of the at least firstmagnetoresistive-layered structure.

According to one embodiment of the invention, the means, or themechanism, for generating the at least first offset magnetic fieldfurther include first means and second means, or a first mechanism and asecond mechanism, for generating a first and a second modifiablecomponent of the at least first offset magnetic field, respectively. Thefirst modifiable component of the at least first offset magnetic fieldhas a first direction and the second modifiable component of the atleast first offset magnetic field has a second direction.

The first and second directions of the respective first and secondmodifiable components of the offset magnetic field are neither parallelnor anti-parallel with respect to each other. These first and seconddirections can be perpendicular. In this way the at least first offsetmagnetic field can be generated in a plane specified by the first andsecond directions, with arbitrary magnitude and arbitrary orientation inthe given plane. In three-dimensional space, the first direction may,for example, refer to the x-direction and the second direction may referto the z-direction. By separately generating x- and z-components of theat least first offset magnetic field, the resulting offset magneticfield may feature an arbitrary direction within the x-z plane.

Making use of, for example, a GMR element as the at least firstmagnetoresistive-layered structure allows the electric resistance thatcan be measured to become maximal when the absolute value of themagnetic field, such as the superimposed magnetic field, in the vicinityof the at least first magnetoresistive-layered structure is minimal. Bymeasuring of the GMR element's electric resistance while simultaneouslymodifying the first component of the at least first offset magneticfield, a maximum of the electric resistance can be measured for a firstvalue of the first modifiable component of the at least first offsetmagnetic field. This first value of the first modifiable component ofthe at least first offset magnetic field is substantially equal inmagnitude to the corresponding component of the external magnetic field.Hence, the maximum of the electric resistance arises when the firstmodifiable component of the at least first offset magnetic field exactlycompensates the corresponding component of the external magnetic field.

After determination of this first value, a corresponding procedure canbe performed with the second modifiable component of the at least firstoffset magnetic field. By sequentially modifying first and secondcomponents of the at least first offset magnetic field, a first andsecond maximum electric resistance of the at least firstmagnetoresistive-layered structure can be precisely determined. Thefirst and second values of the first and second modifiable components ofthe at least first offset magnetic field that correspond to the firstand second maximum electric resistance serve to compensate the externalmagnetic field in the vicinity of the magnetoresistive-layeredstructure.

It can be assumed that the external magnetic field features a firstx-component and a second z-component. By modifying the magnitude of thefirst modifiable component of the at least first offset magnetic fieldthat points in the x-direction, a maximum electric resistance of thefirst magnetoresistive-layered structure can be determined. When theelectric resistance is maximal it can be assumed that the x-component ofthe offset magnetic field exactly compensates the x-component of theexternal magnetic field. In the same way, the z-component of the atleast first offset magnetic field can be modified in order to find acorresponding maximum electric resistance of the at least firstmagnetoresistive-layered structure.

This second maximum electric resistance then determines, or controls,the magnitude of the z-component of the at least first offset magneticfield that serves to compensate the z-component of the external magneticfield. In this way a directional magnetic field sensor can beimplemented by making use of a single GMR element. The first and secondmeans, or mechanisms, for generating respective first and secondmodifiable components of the at least first offset magnetic field mustprovide generation of respective first and second modifiable componentsin the vicinity of the at least first magnetoresistive-layeredstructure.

In this way, it can be effectively guaranteed that the first and secondmodifiable components of the at least first offset magnetic field havethe same impact on the electric resistance of the at least firstmagnetoresistive-layered structure as the corresponding components ofthe external magnetic field. The first and second means, or mechanisms,can effectively provide generation of first and second components inrespective first and second directions as well as in oppositedirections. For example, the first modifiable component may point eitherin x-direction or in the opposite x-direction. The first and secondmeans, or mechanisms, for generating the corresponding first and secondmodifiable components can be electrically controllable, such that themagnitude of the first and second modifiable magnetic field componentscan be controlled by electrical signals.

According to another embodiment of the invention, the means, ormechanisms, for generating the at least first offset magnetic field arefurther adapted to generate an at least second offset magnetic field.This second offset magnetic field is substantially anti-parallel to theat least first offset magnetic field and features a substantially equalmagnitude than the at least first offset magnetic field. Hence, themeans, or mechanisms, for generating the at least first offset magneticfield further provides for reversing the generated offset magnetic fieldas an at least second offset magnetic field. In principle, reversal ofthe at least first offset magnetic field can be generated by theabove-mentioned first and second means, or mechanisms, for generating offirst and second modifiable components of the at least first offsetmagnetic field.

Generating the at least first offset magnetic field provides a firstsuperimposed magnetic field that can be measured by the at least firstmagnetoresistive-layered structure. Correspondingly, generation of thereversed second offset magnetic field provides a second superimposedmagnetic field that can be subsequently measured. By measuring thesefirst and second superimposed magnetic fields by the at least firstmagnetoresistive-layered structure, an inherent magnetic or electricaloffset of the at least first magnetoresistive-layered structure and anintrinsic falsification can be effectively eliminated. Generation of theat least first and second offset magnetic fields is particularlyapplicable in a bridge circuit making use of at least twomagnetoresistive-layered structures.

According to another embodiment of the invention, the means, ormechanisms, for generating of the at least first and/or second offsetmagnetic fields are implemented on the basis of a permanent magneticelement and/or a ferromagnetic element and/or an inductive elementand/or an electrically conductive element. When implemented on the basisof a permanent or a ferromagnetic element featuring a permanentmagnetization, the means, or mechanisms, for generating of the at leastfirst offset magnetic field provide an offset magnetic field of constantmagnitude. The direction is governed by the production process. Byimplementing the means, or mechanisms, for generating of the at leastfirst and/or second offset magnetic fields and their respective firstand second components on the basis of inductive elements and/orelectrically conductive elements, the magnitude and/or the direction ofthe at least first and second offset magnetic fields can be effectivelycontrolled by electrical signals.

For example, the first means, or mechanism, for generating of the firstmodifiable offset magnetic field component can be implemented by makinguse of an electrically conductive wire providing a flow of a currentthat produces a magnetic field in radial direction with respect to theelongated axis of the wire. Arranging a straight wire along thez-direction, a current flowing through that wire may produce a magneticfield in the x-y-plane. By appropriately positioning the at least firstmagnetoresistive-layered structure and the wire, a current flowingthrough the wire in z-direction may produce an x-component of the atleast first offset magnetic field. By reversing the flow of the currentthrough the wire, the corresponding magnetic field will also reverse andmay therefore point in the opposite x-direction.

The magnitude of the current flowing through the wire further determinesthe magnitude of the component of the at least first offset magneticfield. In a similar way, the means, or mechanism, for generating the atleast first offset magnetic field can be implemented on the basis of aninductive element, such as a coil. Furthermore, the strength of theelectric current determines the magnitude of the evolving magneticoffset field and by application of an oppositely directed current, theoffset magnetic field can be reversed. In particular, by making use ofinductive and/or electrically conductive elements, such as coils andwires, the at least first offset magnetic field can be arbitrarilymodified by making use of electrical signals in the form of electricalcurrents.

According to another embodiment of the invention, the means, ormechanisms, for generating of the at least first and/or second offsetmagnetic fields further includes a soft magnetic element that isarranged in the vicinity of the at least first magnetoresistive-layeredstructure. Soft-magnetic materials are those with a magneticpermeability significantly higher than that of free space. Typically,soft-magnetic materials cannot be permanently magnetized to asignificant degree. These properties allow soft-magnetic materials toconduct magnetic flux in much the same way as copper wires are used toconduct electric currents. Common examples of soft-magnetic materialsare pure iron and nickel-iron steels such as Permalloy, FeAlN, CoFe, andCoZrTa.

This soft-magnetic element is adapted to enhance the magnetic field thatis induced by an electric current flowing through the at least firstmagnetoresistive-layered structure. In this way, the magnetic field thatis inevitably generated by a current flowing through the at least firstmagnetoresistive-layered structure serves to magnetize the soft magneticelement. The magnetization of the soft magnetic element can be saturatedand the corresponding demagnetization field of the soft magneticmaterial serves to enhance the magnetic field generated by the electriccurrent that flows through the at least first magnetoresistive-layeredstructure. The current flowing through the at least firstmagnetoresistive-layered structure has to exceed a predefined thresholdfor which the soft magnetic element's magnetization is saturated. Inthis way, a constant offset magnetic field is generated in the vicinityof the at least first magnetoresistive-layered structure. The magnitudeof the magnetic field created by the soft magnetic layer is determinedby the saturation field of the soft magnetic element. The direction ofthe magnetic field created by the soft magnetic elements is determinedby the direction of the current through the magnetic sensitive layer.

Hence, the invention is also applicable if the offset magnetic fielddoes not compensate the external field. In this case the offset magneticfield can be created by a hard magnetic structure with permanentmagnetization of by a soft magnetic structure that is magnetized by thecurrent through the magnetoresistive-layered structure.

According to another embodiment of the invention, the magnetic fieldsensor further includes at least a second magnetoresistive-layeredstructure. The at least first and second magnetoresistive-layeredstructures are arranged in a first bridge circuit and exhibit amagnetoresistive effect, such as a Giant Magnetoresistive (GMR) effect.The bridge circuit can be implemented as a Wheatstone bridge and the atleast first and second magnetoresistive-layered structures can beimplemented as GMR elements of the same type. They can be arranged in anopposite way within the bridge circuit. Since a Wheatstone bridgetypically features at least four resistive elements, the remaining tworesistive elements might be implemented on the basis of resistors beinginsensitive to an applied magnetic field. Alternatively, the fourresistors of the bridge circuit may all be implemented as GMR elementsof the same type series, two of which are shielded from the externalmagnetic field.

According to another embodiment of the invention, the magnitude of theat least first offset magnetic field is substantially larger than themagnitude of the external magnetic field. In this way, a first and asecond superimposed magnetic field can point in opposite directions,provided that the first and the second superimposed magnetic fieldsevolve from a superposition of the external magnetic field and the firstand second offset magnetic fields, where the second offset magneticfield substantially equals the reversed first offset magnetic field.

In particular, by making use of a bridge circuit, such as a Wheatstonebridge, the output signal is substantially linear with the magnitude ofthe superimposed magnetic field applied at the at least first and secondmagnetoresistive-layered structures. Moreover, the output voltage signalis symmetric with respect to a positive and negative superimposedmagnetic field. By superimposing the first offset magnetic field and theexternal magnetic field a first voltage signal can be obtained from thebridge circuit being indicative of the first superimposed magnetic fieldand by reversing the first offset magnetic field, and a second voltageoutput of the bridge circuit can be obtained that is indicative of thesecond superimposed magnetic field.

When the magnitude of the at least first offset magnetic field, and alsoof the at least second offset magnetic field, is substantially largerthan the magnitude of the external magnetic field, the first and secondsuperimposed magnetic fields refer to a rising and falling edge of thecharacteristic voltage diagram of the bridge circuit. The correspondingfirst and second voltage signals can then be mutually subtractedresulting in a voltage signal that is independent of the offset magneticfield as well as any drift offset of the bridge circuit.

According to another embodiment of the invention, the at least firstoffset magnetic field has a substantial equal impact on the at leastfirst and second magnetoresistive-layered structures. Furthermore, theat least second offset magnetic field has a substantial reverse impacton the at least first and second magnetoresistive-layered structures.Hence, in this embodiment the at least first offset magnetic field hasan equal impact on all magnetoresistive-layered structures of theinventive magnetic field sensor. Therefore, the at least first offsetmagnetic field as well as the at least second offset magnetic fieldbeing the reverse first offset magnetic field have a global impact onthe magnetoresistive-layered structures. Any generated offset magneticfield modifies the response of any magnetoresistive-layered structure ofthe magnetic field sensor in the same way.

According to another embodiment of the invention, the at least firstoffset magnetic field has a first impact on the at least firstmagnetoresistive-layered structure and the at least second offsetmagnetic field has a second impact on the at least secondmagnetoresistive-layered structure. In this embodiment, the at leastfirst and second offset magnetic fields do not act in a global way butjust have a local impact on different magnetoresistive-layeredstructures of the magnetic field sensor. Hence, an offset magnetic fieldcan be separately generated for each one of the at least first andsecond magnetoresistive-layered structures. For example, whenimplemented in a bridge circuit, by selectively providing a first offsetmagnetic field to only a first magnetoresistive-layered structure, thebalance of the bridge circuit can be shifted, thus allowing for acalibration of the bridge circuit in the absence and/or presence of anexternal magnetic field.

According to another embodiment of the invention, the magnetic fieldsensor further includes at least a third and a fourthmagnetoresistive-layered structure. The at least first, second, thirdand fourth magnetoresistive-layered structures are arranged in the firstbridge circuit. Additionally, the at least third and fourthmagnetoresistive-layered structures include a soft magnetic element thatis adapted to screen the external and/or offset magnetic field. In thisway, only the first and the second magnetoresistive-layered structuresof the bridge circuit provide an electric resistance depending on themagnitude and/or direction of the external magnetic field.

The at least first and second magnetoresistive-layered structures can bearranged in a diagonal way within the bridge circuit. The soft magneticelements that are either attached to the at least third and fourthmagnetoresistive-layered structure or that are at least arranged inclose proximity to the at least third and fourthmagnetoresistive-layered structures serve as magnetic shields. In thisway, the third and fourth magnetoresistive-layered structures aresubstantially insensitive to the external and/or offset magnetic fields.The first, second, third and fourth magnetoresistive-layered structurescan be of the same type series and feature a substantially equalelectrical resistance. In this way, the four resistive elements of thebridge circuit can be implemented by substantially equal parts, thusinherently providing a balance of the bridge circuit when no externalmagnetic field is applied.

According to another embodiment of the invention, the magnetic fieldsensor further includes at least a first and a second soft magneticplanar structure that is separated by at least a first elongated gap.The at least first magnetoresistive-layered structure is then positionedalong the at least first elongated gap. The at least first and secondsoft magnetic planar structures serve as flux guides that providespatial decomposition of the externally applied magnetic field into itsspatial components that are perpendicular to the elongation of the atleast first gap.

For example, by closely spacing the at least first and second softmagnetic planar structure in the x-direction, the magnetic field linesin the evolving gap represent the x-component of the external magneticfield. In this way, the at least first magnetoresistive-layeredstructure serves to measure the strength of a spatial component of theexternally applied magnetic field. By making use of a plurality of softmagnetic planar structures forming a first and a second elongated gapalong substantially perpendicular directions, a magnitude ofperpendicular components of the external magnetic field can beseparately determined by the at least first and secondmagnetoresistive-layered structure.

Four magnetoresistive-layered structures can be arranged in fourelongated gaps, two of which being parallel and two of which beingperpendicular with respect to each other. Electrically connectingcorresponding first, second, third and fourth magnetoresistive-layeredstructures in a bridge circuit, a directional magnetic field sensor canbe effectively implemented. In particular, by making use of the at leastfirst offset magnetic field, a symmetric output voltage of the bridgecircuit can be made asymmetric by applying the at least first offsetmagnetic field to a single one of the magnetoresistive elements. Thisallows for effectively increasing the unequivocal angular range of adirectional magnetic field sensor.

According to another embodiment of the invention, the magnetic fieldsensor further includes at least a fifth and a sixthmagnetoresistive-layered structure and at least a third and fourth softmagnetic planar structure. The third and fourth soft magnetic planarstructures are separated by at least a second elongated gap and thedirection of the second elongated gap is substantially perpendicular tothe direction of the first elongated gap. The at least fifth and sixthmagnetoresistive-layered structures are positioned along the at leastsecond elongated gap and are further arranged in a second bridgecircuit.

In this way the magnetic field sensor includes a first and a secondbridge circuit each of which being adapted to determine the direction ofan external magnetic field. Since the first and the second elongatedgaps belong to the first and the second bridge circuit, respectively,the first bridge circuit is adapted to provide an output voltage beingindicative of the magnitude of a first component of the externalmagnetic field pointing in a first direction, and the second bridgecircuit is adapted to provide a corresponding second output signal beingindicative of a second component of the external magnetic field thatpoints in a substantially perpendicular direction.

The output signal of both bridge circuits can be subjected to a shiftthat is due to a first and a second offset magnetic field. In this way,each bridge circuit provides an output signal that allows tounequivocally determine the magnitude of the external magnetic field. Inparticular, if the magnitude of the external magnetic field is constantbut the direction of the magnetic field may be subject to modification,the magnitude as well as the sign of a spatial component of the externalmagnetic field can be determined. Combining these output signals of thefirst and the second bridge circuit provides unequivocal determinationof the direction of an external magnetic field over a range from 0° to360°.

In another embodiment of the invention, a method measures an externalmagnetic field by using a magnetic field sensor that has at least afirst magnetoresistive-layered structure. The method includes generationof an at least first offset magnetic field and measuring the electricalresistance of the at least first magnetoresistive-layered structure.This electrical resistance depends on the magnitude of a first magneticfield that includes components of the external magnetic field andcomponents of the offset magnetic field. Typically, the external and theoffset magnetic field superimpose and form a superimposed magnetic fieldthat in turn has an impact on the electrical resistance of themagnetoresistive-layered structure. In this way, the electricalresistance of the at least first magnetoresistive-layered structure isindicative of the magnitude and/or the direction of the superimposedmagnetic field. Having knowledge of the magnitude and/or the directionof the generated offset magnetic field, the magnitude and/or thedirection of the external magnetic field can be precisely determined.

According to another embodiment of the invention, measuring theelectrical resistance of the at least first magnetoresistive-layeredstructure further includes measuring the electrical resistance of the atleast first magnetoresistive-layered structure during modification of afirst component of the at least first offset magnetic field. This firstcomponent of the offset magnetic field has a first direction, forinstance, such that it points in the x-direction. The electricalresistance of the at least first magnetoresistive-layered structure ismeasured during modification of a second component of the at least firstoffset magnetic field. This second component has a second direction,which is, for example, perpendicular to the first direction. Forexample, the second direction points in the z-direction.

In this way, the electrical resistance of the at least firstmagnetoresistive-layered structure is separately measured as a functionof the first and the second component of the at least first offsetmagnetic field. Finally, the magnitude and/or the direction of theexternal magnetic field can be determined by measuring the magnitude ofthe first and the second components of the at least first offsetmagnetic field for which the electrical resistance of the at least firstmagnetoresistive-layered structure is maximal or has a predefined value.

In particular, when the at least first magnetoresistive-layeredstructure is implemented as a GMR element, the electrical resistance ismaximal for zero superimposed magnetic field, such as when external andoffset magnetic field mutually compensate. By varying a component of theoffset magnetic field in the presence of the external magnetic field,the maximum of the electrical resistance of the at least first.magnetoresistive-layered structure will arise if the component of the atleast first offset magnetic field substantially compensates for acorresponding component of the external magnetic field. In the case ofsuch compensation, the magnitudes of the offset component and thecorresponding component of the external magnetic field are substantiallyequal.

Performing this compensation procedure for both components of the offsetmagnetic field allows for a determination of the offset magnetic fieldvector in the plane given by the first and the second directions, suchas within the x-y-plane. In this way, the offset magnetic field can bedetermined for which the electrical resistance of the at least firstmagnetoresistive-layered structure becomes maximal. Since this maximalelectrical resistance is an indication of a substantial compensation ofthe external magnetic field, the magnitude and direction of the externalmagnetic field can therefore be precisely determined. The magnitude ofthe external magnetic field substantially equals the magnitude of theoffset magnetic field and its direction is reversed with respect to theoffset magnetic field.

This embodiment allows for a precise determination of the magnitude anddirection of the external magnetic field in a two-dimensional planegoverned by the first and second directions. When, for example, theexternal magnetic field further includes a magnetic field component inthe third spatial direction, such as the y-direction, the method justallows for determination of its two components lying in the x-z-plane.By implementing the magnetic field sensor in a rotatable way, inprinciple a third spatial component of the external magnetic field alsocan be determined. For example, the magnetic field sensor can be rotatedin such a way that the first direction points in the y-direction and thesecond direction still points in the z-direction. Performing acorresponding procedure, the y- and z-component of the external magneticfield can be determined.

According to another embodiment of the invention, the magnetic fieldsensor further includes at least a second magnetoresistive-layeredstructure. The at least first and the at least secondmagnetoresistive-layered structures are arranged in a first bridgecircuit and the method of measuring the external magnetic field furtherincludes generation of the at least first offset magnetic field that hasa first direction and a first magnitude. This first magnitude of the atleast first offset magnetic field is substantially larger than themagnitude of the external magnetic field that has to be measured by themagnetic field sensor.

A corresponding first output signal of the bridge circuit is nextmeasured and stored. Thereafter, an at least second offset magneticfield is generated that has a second direction and a second magnitude.This second direction is substantially anti-parallel to the firstdirection and the second magnitude is substantially equal to the firstmagnitude. Hence, the second offset magnetic field represents thereversed first offset magnetic field. Then, a corresponding secondoutput signal of the bridge circuit is measured. Finally, the magnitudeof the external magnetic field can be precisely determined by comparingthe first and the second output signals of the bridge circuit.Typically, the first and second output signals of the bridge circuitinclude a first and second output voltage.

The magnitude of the external magnetic field can then be obtained bysubtracting first and second output voltages. The resulting voltagesignal is indicative of twice the magnitude of the external magneticfield but is independent of the magnitude and direction of the at leastfirst and second offset magnetic field as well as any offset voltage ofthe bridge circuit. In this way, even a very small external magneticfield, such as the earth magnetic field, can be precisely measured. Theinventive method therefore enhances the sensitivity of a magnetic fieldsensor and effectively allows for offset compensation of a bridgecircuit, such as a Wheatstone bridge.

According to another embodiment of the invention, the at least first andsecond magnetoresistive-layered structures are arranged in a firstbridge circuit and the method of measuring the external magnetic fieldfurther includes generating of a balance of the bridge circuit in theabsence of the external magnetic field. Generation of the balancefurther includes generation of the at least first offset magnetic field,such as in the vicinity of the at least first magnetoresistive-layeredstructure. Here, the at least first offset magnetic field is generatedlocally in close proximity to the at least firstmagnetoresistive-layered structure and does not have an impact on the atleast second magnetoresistive-layered structure.

Thereafter, the balance of this first bridge circuit is generated in thepresence of the external magnetic field. The generation of this balanceincludes generation of an at least second offset magnetic field. Thissecond offset magnetic field can be generated in the vicinity of the atleast first or second magnetoresistive-layered structure. The magnitudeand/or direction of the external magnetic field can be determined bycomparing the at least first and second offset magnetic fields.

According to another embodiment of the invention, the sensor furtherincludes at least a first and a second soft magnetic planar structurethat are separated by at least a first elongated gap. The at least firstmagnetoresistive-layered structure is positioned along the at leastfirst elongated gap. The method of measuring the external magnetic fieldincludes generating the at least first offset magnetic field in thevicinity of the at least first magnetoresistive-layered structure, andmeasuring a first output signal of the first bridge circuit in thepresence of the external magnetic field and the at least first offsetmagnetic field. The method further includes determining of the magnitudeof a first component of the external magnetic field on the basis of theoutput voltage and the magnitude of the at least first offset magneticfield.

The direction of the first component of the external magnetic field canbe substantially perpendicular to the direction of the elongated gap. Inthis embodiment, the at least first and second soft magnetic planarstructures serve as flux guides in order to decompose the externalmagnetic field into various spatial components. The at least firstmagnetoresistive-layered structure is adapted to measure a firstcomponent of the external magnetic field that points in a perpendiculardirection compared to the elongation of the gap.

Typically, the bridge circuit is implemented as a Wheatstone bridgehaving at least a first and a second magnetoresistive-layered structurefor determining two components of the external magnetic field.Generation of the at least first offset magnetic field in the vicinityof only one magnetoresistive element then serves to shift the balance ofthe bridge circuit. Without any offset field, the output signal of abridge circuit is a function of the absolute value of the externalmagnetic field. By applying an offset magnetic field, the magnetic fieldat the sensor position never changes the direction as long the offsetfield does not change the direction and the magnitude of the externalfield is smaller than the magnitude of the offset field. Under thiscondition, the range of unequivocal determination of a direction of anexternal magnetic field can be enhanced from 0° to 90° to 0° to 180°.

In another embodiment of the invention, an electronic device determinesa direction of an external magnetic field. The electronic deviceincludes means, or a mechanism, for generating of an at least firstoffset magnetic field, at least a first magnetoresistive-layeredstructure that has an electrical resistance that depends on themagnitude of a first magnetic field. This first magnetic field includescomponents of the external magnetic field and components of the offsetmagnetic field. The electronic device further includes a control unitfor controlling generation of the at least first offset magnetic fieldand for determining the direction of the external magnetic field on thebasis of the magnitude of the at least first offset magnetic field andthe electrical resistance of the at least first magnetoresistive-layeredstructure.

Still other embodiments and aspects of the invention will becomeapparent by reading the detailed description that follows, and byreferring to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The drawings referenced herein form a part of the specification.Features shown in the drawing are meant as illustrative of only someembodiments of the invention, and not of all embodiments of theinvention, unless otherwise explicitly indicated, and implications tothe contrary are otherwise not to be made.

FIG. 1 is a diagram schematically illustrating amagnetoresistive-layered structure with first and second means, ormechanisms, for generating first and second components of the offsetmagnetic field by using straight wires, according to an embodiment ofthe invention.

FIG. 2 is a diagram schematically illustrating amagnetoresistive-layered structure with first and second means, ormechanisms, for generating first and second components of the offsetmagnetic field by using coils, according to an embodiment of theinvention.

FIG. 3 is a diagram of the electrical resistance of amagnetoresistive-layered structure versus the magnitude of the externalmagnetic field, according to an embodiment of the invention.

FIG. 4 is a diagram schematically showing a Wheatstone bridgearrangement having at least first and second magnetoresistive-layeredstructures, according to an embodiment of the invention.

FIG. 5 is a diagram of the output voltage of a Wheatstone bridge versusan externally applied magnetic field, according to an embodiment of theinvention.

FIG. 6 is diagram schematically showing a Wheatstone bridge arrangementwith a locally applied offset magnetic field, according to an embodimentof the invention.

FIG. 7 is a diagram of an output voltage diagram of a Wheatstone bridgearrangement with a local offset magnetic field, according to anembodiment of the invention.

FIG. 8 is a diagram of a Wheatstone bridge arrangement having fourmagnetoresistive-layered structures, two of which are shielded from anexternal magnetic field, according to an embodiment of the invention.

FIG. 9 is a diagram schematically showing generation of a constantoffset magnetic field by magnetizing a soft magnetic material, accordingto an embodiment of the invention.

FIG. 10 is a flowchart of a method for determining magnitude and/ordirection of an external magnetic field by using a bridge circuit,according to an embodiment of the invention.

FIG. 11 is a flowchart of a method for determining the magnitude of anexternal magnetic field by using a bridge circuit, according to anembodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

In the following detailed description of exemplary embodiments of theinvention, reference is made to the accompanying drawings that form apart hereof, and in which is shown by way of illustration specificexemplary embodiments in which the invention may be practiced. Theseembodiments are described in sufficient detail to enable those skilledin the art to practice the invention. Other embodiments may be utilized,and logical, mechanical, and other changes may be made without departingfrom the spirit or scope of the present invention. The followingdetailed description is, therefore, not to be taken in a limiting sense,and the scope of the present invention is defined only by the appendedclaims.

FIG. 1 schematically illustrates a magnetic field sensor having amagnetoresistive-layered structure 100 and first and second means, ormechanisms, for generating first and second components of an offsetmagnetic field, according to an embodiment of the invention. The firstand second means, or mechanisms, for generating first and secondcomponents of the offset magnetic field are implemented in theembodiment of FIG. 1 by electrically conducting wires 102, 104. Wire 102is arranged along the z-direction near the bottom side of themagnetoresistive-layered structure 100 and provides flow of a currentI_(z) 108. When flowing through the wire 102, the current 108 generatesa magnetic field 112 that points in the x-direction near the bottom sideof the magnetoresistive-layered structure 100.

In a similar way the second wire 104 is arranged along the x-directionand provides flowing of a current 106. The wire 104 is arranged near thetop side of the magnetoresistive-layered structure 100. When the currentI_(x) 106 flows through the wire 104, it generates a component of themagnetic offset field 110 that points in the z-direction in closeproximity to, or near, the upper side of the magnetoresistive-layeredstructure 100.

In this way, an offset magnetic field having components in the x- andz-direction can be generated by the two currents I_(x) 106 and I_(z)108. In one embodiment, the magnitude and direction of the currents 106and 108 is controllable and hence the direction and magnitude of theresulting offset magnetic field can be arbitrarily modified in the x-zplane. In one embodiment, the magnetoresistive-layered structure 100 isimplemented as a GMR element providing an electrical resistance thatdepends on the magnitude of an applied magnetic field, such as asuperimposed magnetic field. By varying the current 106 andsimultaneously monitoring the electrical resistance of themagnetoresistive-layered structure 100, a maximum electric resistancecan be determined when the corresponding component 110 of the offsetmagnetic field exactly compensates the z-component of the externalmagnetic field.

Subsequently and in the same way, the current 108 can be modified inorder to determine a component 112 of the offset magnetic field thatexactly compensates the x-component of the external magnetic field. Thetwo values of the currents 106 and 108 that lead to the maximum electricresistance of the magnetoresistive-layered structure 100 are thenindicative of the magnitudes of the x- and z-components of the offsetmagnetic field that exactly compensates the external magnetic field. Inthis way the magnitude and direction of the external magnetic field inthe x-z-plane can be precisely determined.

Generation and variation of the currents 106 and 108 can be provided bya control unit that may also provide measuring of the electricalresistance of the magnetoresistive-layered structure 100. Determinationof the maximum electric resistance of the magnetoresistive-layeredstructure 100 can be realized by making use of a corresponding controlloop, for instance.

FIG. 2 shows an alternative embodiment of the magnetic field sensor,wherein the electrical conducting wires 104 and 102 are effectivelyreplaced by inductive elements 114, 116, that are, for instance,implemented as coils. In the embodiment of FIG. 2, coil 116 providesgeneration of a magnetic field component 110 in the x-direction and coil114 provides generation of a perpendicular magnetic field component 112pointing in the z-direction. Compared to the embodiment of FIG. 1, thecoils 114, 116 in the embodiment of FIG. 2 provide respective magneticfield components 112 and 110 that are larger in magnitude when currents106 and 108 are applied.

FIG. 3 depicts a resistance diagram 300 reflecting the electricalresistance of the magnetoresistive-layered structure 160 versus anapplied external magnetic field or a superimposed magnetic field,according to an embodiment of the invention. This applied external orsuperimposed magnetic field has components of the external magneticfield and of the offset magnetic field generated by the wires 102, 104or by the coils 114, 116, as illustrated in FIGS. 1 and 2. Theresistance diagram 300 can be for the electric resistance of a GMRelement depending on an applied magnetic field. The electric resistancemay be symmetric with respect to zero applied magnetic fields.Additionally, the electric resistance is maximal for zero appliedmagnetic fields.

In the illustrated resistance diagram 300 three resistance curves 302,304 and 306 are depicted. The linear resistance curve 302 that isillustrated as dashed line features a constant offset compared to thelinear resistance curve 304 that is illustrated as a solid line. Incontrast to the linear resistance curves 302 and 304, the resistancecurve 306 is non-linear. The three resistance curves 302, 304, 306 mayrefer to different type series of GMR elements or to the same GMRelement that is operated under varying external conditions, such asvarying temperature or varying voltage or current applied to therespective GMR element. By applying an external magnetic field of astrength of minus B₁, three intersection points 308, 310, and 312 forthe various GMR elements can be obtained.

To each intersection point 308, 310, and 312 a corresponding electricresistance of the magnetoresistive-layered structure can be determined.By using a GMR element featuring the linear resistance curve 304, inprinciple the electric resistance corresponding to intersection point310 can be measured. Using the knowledge of the linear resistance curve304 as well as the knowledge of the external parameters, for which thisparticular linear resistance curve 304 is valid, the magnitude of theapplied magnetic field B₁ can then be determined.

For example, due to a different temperature, the linear resistance curve304 might be shifted to the linear resistance curve 302. In this case,the electric resistance corresponding to the intersection 308 isdifferent than the electrical resistance corresponding to theintersection 310. Hence, measuring an absolute value of the electricresistance of a magnetoresistive-layered structure is not insensitive toan offset that may arise due to varying external conditions.

Any influence that shifts the resistance curve 304 to a resistance curvelike 302 or 306 does not change the value of the corresponding magneticfield where the resistance of each curve has its maximum. This means themaximum of the resistance curve is insensitive to any shift of theresistance curve. By applying an offset magnetic field of varyingmagnitude and simultaneously monitoring the corresponding electricresistance of the magnetoresistive-layered structure, the maximumelectric resistance can be determined. The offset magnetic field thathas to be applied in order to obtain the maximum electric resistance isthen directly indicative of the magnitude of the external magnetic fieldirrespective of a particular linear or non-linear resistance curve 302,304, and 306 that is valid for the GMR element.

In the resistance diagrams shown in FIG. 3 the maximum resistance is atthe point where the superimposed magnetic field is zero. Hence, bygenerating an offset magnetic field of equal magnitude and oppositedirection than the magnitude and direction of the external magneticfield, the resistance reaches its maximum. Because the magnitude andsign of the external magnetic field can be determined directly from theoffset field this approach is insensitive to an offset of a resistancediagram. Furthermore, determination of the maximum electric resistanceof the GMR element can be accomplished by generating an offset magneticfield that is universally applicable to linear and non-linear resistancecurves 302, 304, and 306 of a GMR element.

An arbitrary direction of the magnetic offset field can be created inthe sensitive plane (x-z plane) of the magnetic sensitive material.Using a feedback loop, the external magnetic field in the sensitiveplane of the magnetic sensitive material can be compensated for by theoffset magnetic field so that the resistance of the magnetic sensitivematerial reaches its maximum. By knowing the magnetic offset field, themagnitude and direction of the external magnetic field can bedetermined.

As a result, the magnitude and sign of the two components Bx and Bz inthe x-z plane can be determined. The combination of a magnetic sensitiveelement, which reduces its resistance when a magnetic field is presentin its sensitive plane, and a means, or mechanism, to create anarbitrary magnetic offset field in this plane, allows the magnitude anddirection of an external magnetic field to be measured within a range of0° to 360°.

Moreover if a magnetic-sensitive material or device is used that reducesthe resistance or another measurable property depending on the magnitudeand direction of an external magnetic field, a means or mechanism tocreate a magnetic offset field in any spatial direction can compensatefor the external magnetic field by using a feedback loop approach. Byknowing the magnetic offset field, for instance, the magnitude andspatial direction of external magnetic field can be determined.Consequently, the magnitude, the bearing, and the declination of theexternal magnetic can be determined.

Instead of using a magnetic-sensitive material or a magnetic-sensitivedevice that reduces the resistance or any other measurable property if amagnetic field is applied, a material or device that increases inresistance or any other measurable property can instead becorrespondingly used. Because a feedback approach can be employed, it isnot necessary that the transfer curve of the material of the device islinear.

Instead of compensating the external magnetic field by the offsetmagnetic field, such as by retrieving the maximum electric resistance ofthe GMR element, the offset magnetic field may be modified in such a waythat the electric resistance of the GMR element corresponds to theinitial electric resistance. For example, initially an electricresistance is determined that corresponds to the intersection point 310,and the offset magnetic field can be modified until the same electricresistance that corresponds to intersection point 316 is measured.Hence, the offset magnetic field is modified in such a way that itsubstantially equals twice the magnitude of the external magnetic fieldB₁. In this way, the method effectively allows to compensate ahorizontal offset of the linear and non-linear resistance curves 302,304, and 306.

Measuring the initial electric resistance corresponding to intersectionpoint 308 then requires modification of the offset magnetic field inorder to move on the linear resistance curve 302 up to the intersectionpoint 318. In the same way, the intersection point 312 is started fromand the offset magnetic field is modified until the intersection point314 is reached.

FIG. 4 schematically illustrates a bridge circuit 400 that isimplemented as a Wheatstone bridge having four resistive elements 402,404, 406, and 408, according to an embodiment of the invention. At leasttwo of the resistive elements are implemented asmagnetoresistive-layered structures 402 and 406. Thesemagnetoresistive-layered structures 402 and 406 can be implemented asGMR elements and they are arranged in an opposite or diagonal way withinthe bridge circuit 400. The bridge circuit 400 further has two inputterminals 414 and 416 for applying an input voltage or an input currentand further has two output terminals 410 and 412 that are arrangedbetween the GMR element 402 and the resistor 408, and between the GMRelement 406 and the resistor 404, respectively. The two resistors 404and 408 can be insensitive to a magnetic field. They can in principle beimplemented as GMR elements of the same type series as the GMR elements402 and 406 in order to provide substantially equal electricalproperties. However, when implemented as GMR elements, the resistors 404and 408 are desirably shielded from an external or offset magnetic fieldby using a soft magnetic material, for instance. Upon applying anexternal magnetic field 418, the electric resistance of the oppositelyarranged GMR elements 402 and 406 may change, leading to a voltagesignal across the two output terminals 410, 412.

In FIG. 5 a corresponding bridge output diagram 500 is shown thatillustrates the output voltage 502 versus the magnitude of an appliedmagnetic field, according to an embodiment of the invention. In theabsence of a magnetic field, the output voltage of the bridge circuit400 is minimal as is seen from the intersection point 504. This minimaloutput voltage 504 does not necessarily have to be equal to zero,because the bridge circuit can be subject to some offset drift that mayresult from manufacturing tolerances of the resistors 402, . . . , 408.

FIG. 5 shows the effect of superimposing an offset magnetic field 422 ontop of the external magnetic field 418. In relation to FIG. 5, theexternal magnetic field is denoted as B₁ and the offset magnetic fieldis denoted as B₀. By generating an offset field 422 in the direction ofthe external magnetic field 418, the superimposed magnetic field B₁ plusB₀ results in a first voltage at intersection point 506. In a secondmeasurement, the direction of the offset magnetic field is reversed andforms a second offset magnetic field 420. Since the offset magneticfield 422 and 420 is larger in magnitude than the external magneticfield 418, a second voltage can be determined that corresponds to theintersection point 508. In relation to FIG. 5, the first voltage refersto a positive superimposed magnetic field and the second voltage refersto a negative superimposed magnetic field, such as the secondsuperimposed magnetic field points in the opposite direction than thefirst superimposed magnetic field.

By subtracting the first and second voltage signals that correspond tothe first and second intersection points 506, 508 a voltage difference510 is obtained. This voltage difference is indicative of twice themagnitude of the external magnetic field B₁. Additionally, the voltagedifference 510 is independent of any bridge offset and is independent ofthe offset magnetic field B₀. Hence, by applying an offset magneticfield that is larger in magnitude than the field to be measured, anoffset compensation of a Wheatstone bridge can be effectively realized.In this way, the sensitivity of a magnetic field sensor making use of aWheatstone bridge arrangement can be enhanced. Furthermore, thisapproach is insensitive to any offset shift of the output U, because theshift influences the intersection 508 and 506 in the same way, and bysubtracting the value of intersection 506 from that of the intersection508 the offset shift is effectively eliminated.

The two offset magnetic fields 422, 420 can be generated globally, suchthat, for instance, the offset magnetic field affects the electricresistance of GMR elements 402 and 406 in almost the same way. This canbe achieved by arranging equal means, or mechanisms, for generatingoffset magnetic fields in close proximity to GMR elements 402 and 406.

FIG. 6 schematically illustrates the same bridge circuit as FIG. 4,except that the offset magnetic field 420 is only locally applied to atleast one of the magnetoresistive-layered structures 402 and 406,according to an embodiment of the invention. The offset magnetic field420 may be applied to only one GMR element 406 in order to shift thebridge output diagram 500, as is illustrated in FIG. 7. By applying apositive offset magnetic field B₀, the minimum of the output curve 520shifts to the left by an amount −B₀. Consequently, the output curve 502is transformed to the shifted output curve 514. The minimum voltage thatcorresponds to the intersection point 526 can be obtained when theexternal magnetic field equals −B₀.

Applying an external magnetic field of B₁ results in a voltage signalthat corresponds to the intersection point 522. By using the outputcurve 502 and measuring such a voltage signal, the intersection points520 and 522 cannot be properly distinguished. The measured outputvoltage signal may either correspond to a positive or negative externalmagnetic field of magnitude B₁. Therefore, by applying the offsetmagnetic field locally at one of the magnetoresistive elements 406, theshifted output curve 514 is valid. Hence, the intersection point 526corresponding to a minimal output voltage is shifted to the left,allowing for an unequivocal determination of the external magnetic fieldover a range from at least −B₀ to +B₀.

Intersection point 520 effectively moves to intersection point 524. Thetwo intersection points 522 and 524 that correspond to differentmagnitudes of external magnetic field now correspond also to differentvoltage outputs of the bridge circuit 400. Therefore, not only themagnitude but also the sign and hence the direction of an appliedexternal magnetic field can be determined by the illustrated shift ofthe output curve 502.

Shifting of an output curve of a bridge circuit may be applicable oruseful when the bridge is adapted to determine the magnitude of aparticular spatial component of the external magnetic field. FIG. 8 isillustrative of such an embodiment that uses two flux guides 430 and 432that includ a soft magnetic material. These flux guides 430 and 432serve to screen the external magnetic field 418. When arranged in closeproximity, or near one another, such that the two flux guides 430 and432 form an elongated gap (along the z-direction as illustrated in FIG.8), the magnetic field that can be measured between the two flux guides430 and 432 substantially represents the x-component 424 of theexternally applied magnetic field 418.

The flux guides 430 and 432 may not only serve to separate thecomponents of the externally applied magnetic field but may also serveto shield the GMR elements 426, 428 of the bridge circuit 400, in oneembodiment of the invention. The other two GMR elements 402 and 406 arethen sensitive to the magnitude of the x-component 424 of the externallyapplied magnetic field. Applying an offset magnetic field 420 to, forinstance, GMR element 426, can result in the output curve 502 of thebridge circuit 400 being shifted as illustrated in FIG. 7. Consequently,the output voltage obtained from the bridge circuit of FIG. 8 issuitable for determining the magnitude of the x-component 424 as well asits sign, such as whether it points in the positive or negativex-direction.

When the magnitude of the external magnetic field 418 is smaller thanthe magnitude of the offset magnetic field 420, the bridge circuitillustrated in FIG. 8 may provide unequivocal determination of thex-component of the externally applied magnetic field. In the same way, asecond bridge circuit can be implemented that is rotated by 90° and thusprovides a corresponding determination of the z-component of theexternal magnetic field. Combining the corresponding output voltages ofthe x-component bridge circuit and the z-component bridge circuit, adirectional magnetic sensor can be realized that allows for anunequivocal determination of the direction of an external magnetic fieldover a range from 0° to 360°.

FIG. 9 schematically illustrates generation of a constant offsetmagnetic field by using a magnetoresistive-layered structure 100 and asoft magnetic element 118, according to an embodiment of the invention.In order to measure the electric resistance of themagnetoresistive-layered structure 100, a current 120 is applied thatflows through the magnetoresistive-layered structure 100. Consequently,the current 120 generates a magnetic field 122 in a radial directionwith respect to the current direction. When the magnitude of the current120 is above a predetermined threshold, the corresponding magnetic field122 may serve to entirely magnetize the soft magnetic element 118.Hence, the soft magnetic element 118 may feature a saturatedmagnetization 124.

The threshold value for the magnitude of the current 120 can be governedby the saturation of the magnetization of the soft magnetic element 118.The corresponding demagnetization field 126 is then present at themagnetoresistive-layered structure 100. In one embodiment, thisdemagnetization field 126 is much larger in magnitude than the magneticfield 122 generated by the current 120. Additionally, when the current120 is above the predetermined saturation threshold, the demagnetizationfield 126 remains constant irrespective of the magnitude of the current120. However, the direction of the demagnetization field can be changedby 180° if the direction of the current is reversed. In this way, aconstant magnetic offset field 126, with alterable direction, can beinduced by a current 120 flowing through the magnetoresistive-layeredstructure 100.

FIG. 10 is illustrative of a flowchart of a method for measuring themagnitude and/or the direction of an external magnetic field, using of abridge circuit, according to an embodiment of the invention. In relationto FIG. 10, a first and/or second offset magnetic field can be locallyapplied to at least a first and a second magnetoresistive element of thebridge circuit. Furthermore, the bridge may be unbalanced, such that itprovides an output voltage even in absence of a magnetic field. In afirst part 600 the output voltage of the bridge is measured, which givesan indication that the bridge is subject to some kind of offset drift.In a successive part 602, the offset magnetic field that is applicableto one of the magnetoresistive elements of the bridge is tuned until thebridge is balanced.

In one embodiment, this offset magnetic field is generated by electricalsignals, such as by a current flowing through a coil or through astraight wire. In the following part 604 this offset voltage or offsetcurrent that is needed to balance the bridge is maintained and stored bya control device that is adapted to control the current flowing throughthe coil or wire. Thereafter, in part 606 the external magnetic field isapplied. Consequently, the output of the bridge no longer remains zerobut features some non-zero value.

In the following part 608 the offset magnetic field is repeatedly tunedwhile the output voltage of the bridge is simultaneously monitored. Theoffset magnetic field is tuned until the bridge is repeatedly balanced.In one embodiment, this balance occurs for a second offset voltage orcorresponding offset current that is determined in the successive part610. In the following part 612 the first and second offset voltages orfirst and second offset currents for generating the first and secondoffset magnetic fields are compared. Finally, in part 614 the externalmagnetic field can be derived on the basis of the comparison of thefirst and second output signals performed in part 612.

The illustrated flowchart of the method of FIG. 10 can be used todetermine the magnitude of the externally applied magnetic field.Moreover, when the magnetoresistive-layered structures are sandwichedbetween flux guides that provide decomposition of the external magneticfield into various spatial components, the method of FIG. 10 can also beused to determine the direction of the external magnetic field.

FIG. 11 illustrates a flowchart of a method for measuring the magnitudeof the external magnetic field by simultaneously compensating an offsetdrift of a bridge circuit, according to an embodiment of the invention.In relation to FIG. 11, a first and a second offset magnetic field ofequal magnitude but opposite direction are sequentially applied. Inprinciple, the method of FIG. 11 corresponds to the bridge outputdiagram 500 illustrated in FIG. 5. In a first part 700 a first offsetmagnetic field is applied in a first direction. This offset magneticfield B₀ is larger in magnitude than the external magnetic field thathas to be measured by the bridge circuit.

In a successive part 702, the resulting superimposed magnetic fieldhaving components of the external and the offset magnetic field ismeasured by the output signal produced by the bridge circuit 400.Thereafter, in part 704, this first bridge output is stored. Assumingthat the offset magnetic field points in the same direction as theexternal magnetic field, the first output of the bridge corresponds to avoltage at intersection point 506. After obtaining this first voltagesignal, the direction of the offset magnetic field is then reversed inpart 706. Since the magnitude of the offset magnetic field is largerthan the magnitude of the external magnetic field, the resultingsuperimposed magnetic field having components of the external field andof the reversed offset magnetic field points in the opposite directionthan the external field 418.

In part 708, this second superimposed magnetic field can be measured bythe bridge circuit, resulting in a second intersection point 508, asillustrated in FIG. 5, that specifies a second voltage output of thebridge circuit. After sequentially applying the offset magnetic fieldand the reversed offset magnetic field and obtaining corresponding firstand second voltage signals, a voltage difference 510 between the twovoltage signals can be determined in part 710 by comparing the first andthe second bridge output signal. This voltage difference 510 is directlyindicative of the magnitude of the external magnetic field. Inparticular, the voltage difference 510 is proportional to twice theexternal magnetic field. Therefore, from the comparison of the first andsecond bridge output signals in the final part 712, the magnitude of theexternal magnetic field can be precisely determined. In particular, thedetermination of the magnitude of the external magnetic field isindependent of the magnitude of the offset magnetic field B₀. Moreover,the voltage difference is independent of any offset of the bridgecircuit so long as the first and the second obtained voltage signalsrefer to different edges of the output curve 502 of the bridge outputdiagram 500.

It is noted that, although specific embodiments have been illustratedand described herein, it will be appreciated by those of ordinary skillin the art that any arrangement calculated to achieve the same purposemay be substituted for the specific embodiments shown. This applicationis thus intended to cover any adaptations or variations of embodimentsof the present invention. Therefore, it is manifestly intended that thisinvention be limited only by the claims and equivalents thereof.

1. A magnetic field sensor for measuring an external magnetic field,comprising: a mechanism to generate a first offset magnetic field; and,a first magnetoresistive-layered structure having an electricalresistance depending on a magnitude of a first magnetic field, the firstmagnetic field comprising components of the external magnetic field andcomponents of the first offset magnetic field.
 2. The magnetic fieldsensor of claim 1, wherein the mechanism comprises: a firstsub-mechanism to generate a first modifiable component of the firstoffset magnetic field and having a first direction; and, a secondsub-mechanism to generate a second modifiable component of the firstoffset magnetic field and having a second direction.
 3. The magneticfield sensor of claim 1, wherein the mechanism is adapted to furthergenerate a second offset magnetic field, the second offset magneticfield substantially anti-parallel to the first offset magnetic field,the first and the second offset magnetic fields having substantiallyequal magnitude.
 4. The magnetic field sensor of claim 1, wherein themechanism comprises at least one of: a permanent magnetic element, aferromagnetic element, an inductive element, and an electricallyconductive element.
 5. The magnetic field sensor of claim 1, wherein themechanism comprises a soft magnetic element arranged near the firstmagnetoresistive-layered structure, the soft magnetic element adapted toenhance a magnetic field induced by an electric current flowing throughthe first magnetoresistive-layered structure, and further adapted to besaturated by the magnetic field.
 6. The magnetic field sensor of claim1, further comprising a second magnetoresistive-layered structure, thefirst and the second magnetoresistive layered structures arranged in afirst bridge circuit and exhibiting a magnetoresistive effect.
 7. Themagnetic field sensor of claim 6, wherein the first offset magneticfield has a substantially equal effect on both the first and the secondmagnetoresistive-layered structures.
 8. The magnetic field sensor ofclaim 6, wherein the mechanism is to further generate a second offsetmagnetic field, and wherein the first offset magnetic field has a firsteffect on the first magnetoresistive-layered structure and the secondoffset magnetic field has a second effect on the secondmagnetoresistive-layered structure different than the first effect. 9.The magnetic field sensor of claim 6, further comprising a thirdmagnetoresistive-layered structure and a fourth magnetoresistive-layeredstructure, the first, the second, the third, and the fourthmagnetoresistive-layered structures arranged in the first bridgestructure, and the third and the fourth magnetoresistive-layeredstructures comprising a soft magnetic element adapted to screen at leastone of the external magnetic field and the first offset magnetic field.10. The magnetic field sensor of claim 9, further comprising a firstsoft magnetic planar structure and a second soft magnetic planarstructure separated from one another by a first elongated gap, the firstmagnetoresistive-layered structure positioned along the first elongatedgap.
 11. The magnetic field sensor of claim 10, further comprising afifth magnetoresistive-layered structure and a sixthmagnetoresistive-layered structure, and a third soft magnetic planarstructure and a fourth soft magnetic planar structured separated fromone another by a second elongated gap, a direction of the secondelongated gap substantially perpendicular to a direction of the firstelongated gap, the fifth and the sixth magnetoresistive-layeredstructures positioned along the second elongated gap and arranged in asecond bridge circuit.
 12. The magnetic field sensor of claim 1, whereina magnitude of the first offset magnetic field is substantially largerthan a magnitude of the external magnetic field.
 13. A magnetic fieldsensor for measuring an external magnetic field, comprising: means forgenerating a first offset magnetic field; and, a firstmagnetoresistive-layered structure having an electrical resistancedepending on a magnitude of a first magnetic field, the first magneticfield comprising components of the external magnetic field andcomponents of the first offset magnetic field.
 14. The magnetic fieldsensor of claim 13, wherein the means comprises: means for generating afirst modifiable component of the first offset magnetic field and havinga first direction; and, means for generating a second modifiablecomponent of the first offset magnetic field and having a seconddirection.
 15. A method for measuring an external magnetic field byusing a magnetic field sensor having a first magnetoresistive-layeredstructure, comprising: generating a first offset magnetic field;measuring an electrical resistance of the first magnetoresistive-layeredstructure, the electrical resistance depending on a magnitude of a firstmagnetic field, the first magnetic field having components of theexternal magnetic field and components of the first offset magneticfield; and, determining the external magnetic field based on the firstoffset magnetic field and the electrical resistance.
 16. The method ofclaim 15, further comprising: measuring an electrical resistance of thefirst magnetoresistive-layered structure during modification of a firstcomponent of the first magnetic field, the first component having afirst direction; measuring an electrical resistance of the firstmagnetoresistive-layered structure during modification of a secondcomponent of the first magnetic field, the second component having asecond direction; and, determining at least one of a magnitude and adirection of the external magnetic field by determining a magnitude ofeach of the first and the second components of the first magnetic fieldfor which the electrical resistance of the firstmagnetoresistive-layered structure is one of maximal and a predefinedvalue.
 17. The method of claim 15, wherein the magnetic field sensorfurther has a second magnetoresistive-layered structure, the first andthe second magnetoresistive structures arranged in a first bridgecircuit, the method further comprising: generating the first offsetmagnetic field having a first direction and a first magnitudesubstantially larger than a magnitude of the external magnetic field;measuring a first output signal of the first bridge circuit; generatinga second offset magnetic field having a second direction and a secondmagnitude, the second direction substantially anti-parallel to the firstdirection and the second magnitude substantially equal to the firstmagnitude; measuring a second output signal of the first bridge circuit;and, determining the magnitude of the external magnetic field bycomparing the first and the second output signals and the magnitude ofat least one of the first and the second offset magnetic fields.
 18. Themethod of claim 17, further comprising: generating a balance of thefirst bridge circuit with the external magnetic field absent, such thatthe first offset magnetic field is generated; and, generating a balanceof the first bridge circuit with the external magnetic field present,such that the second offset magnetic field is generated.
 19. The methodof claim 18, wherein the magnetic field sensor further has a first softmagnetic planar structure and a second soft magnetic planar structureseparated from one another by a first elongated gap, the firstmagnetoresistive-layered structure positioned along the first elongatedgap, wherein the first offset magnetic field is generated near the firstmagnetoresistive-layered structure, and wherein the first output signalof the first bridge circuit is measured with the external magnetic fieldand the first offset magnetic field present, the method furthercomprising: determining a magnitude of a first component of the externalmagnetic field based on the first output signal and a magnitude of thefirst offset magnetic field, a direction of the first component of theexternal magnetic field being substantially perpendicular to a directionof the first elongated gap.
 20. An electronic device for determining atleast one of a direction and a magnitude of an external magnetic field,comprising: a mechanism to generate a first offset magnetic field; afirst magnetoresistive-layered structure having an electrical resistanceon depending on a magnitude of a first magnetic field, the firstmagnetic field having components of the external magnetic field andcomponents of the first offset magnetic field; and, a control unit tocontrol generation of the first offset magnetic field and to determinethe direction of the external magnetic field based on a magnitude and adirection of the first offset magnetic field and the electricalresistance of the first magnetoresistive-layered structure.